<style type="text/css">
.fui-cellone {
    position: relative;
    padding: 0.3rem 0.5rem;
	-webkit-align-items: flex-start;
	align-items:flex-start;
}
.fui-cellone .fui-cellone-label,.fui-cellone .fui-cellone-remark {
    width: 2.7rem;
}
.fui-cellone .fui-cellone-text .text{
    background: #fff;
    border-radius: 0.3rem;
	padding:0.3rem 0.4rem;
	font-size:0.7rem;
    color: #333;
    width: auto;
}
.fui-cellone-remark .pic{float: right;width: 2rem;height: 2rem;border-radius: 0.2rem; margin-left:0.7rem;}
.fui-cellone-label .pic{float: left;width: 2rem;height: 2rem;border-radius: 0.2rem;margin-right: 0.7rem;}
.logtime{text-align:center;font-size: 0.7rem;line-height:2;width:7.6rem;margin: 0.6rem auto 0;color: #fff;background: #ccc;border-radius: 0.2rem;}
body,html,#mainpage,#sendbox{width: 100%;height: 100%;background: #F2F2F2;}
#sendbox {-webkit-box-orient: vertical;-webkit-flex-direction: column;-moz-flex-direction: column;-ms-flex-direction: column;-o-flex-direction: column;flex-direction: column;}
#sendbox .chat-main{-webkit-box-flex: 1;-moz-box-flex: 1;-webkit-flex: 1;-ms-flex: 1;flex: 1;width: 100%;font-size: 0.65rem;overflow-x: hidden;-webkit-overflow-scrolling: touch;background: #F2F2F2;display: block;}
#sendbox .chat-main .chatlog(padding: 0.2rem;width:100%)
#sendbox .r .text{float: right;}
#sendbox .l .text{float: left;}
#chat-foot{height: 2.5rem;background: #fff;width: 100%;border-top: #EBEBEB solid 1px;padding: 0.4rem 0.2rem;z-index:11}
#chat-foot span {line-height:1.3rem;font-size:1.4rem;}
#chat-foot .inp{float: left; display: block;color: #333;text-indent: 0.6rem;line-height:1.4rem}
#chat-foot input{border:none;}
#chat-foot .sub-btn{width:2.5rem;text-align:center;float: right;background: #18bc9c;color: #fff;border-radius: 0.2rem;margin:0 0.1rem 0.2rem 0}
#chat-foot .showaudio{width:80%;border: 1px solid #EBEBEB;border-radius: 0.1rem;text-align:center;margin-left:0.2rem;padding:0.1rem 2rem;}
.fui-content {
	position: absolute;
	display: block;
	width: 100%;
	height:100%!important; 
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom:0
}
.chatlog {
	min-height:100%!important; 
	display: box;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-flex-direction: row;
    -moz-flex-direction: row;
    -ms-flex-direction: row;
    -o-flex-direction: row;
    flex-direction: column-reverse;
	overflow-x:Hidden;
	overflow-y:auto;
}
.fui-cell {
	position: relative;
	display: -webkit-box;
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-webkit-align-items: center;
	-ms-flex-align: center;
	align-items: center;
	-moz-transition-duration: 300ms;
	-webkit-transition-duration: 300ms;
	transition-duration: 300ms;
	-webkit-transition-property: background-color;
	transition-property: background-color;
	line-height: 1;
}
.fui-cell .text{font-size:0.8rem;line-height:1.2rem}
.fui-cell .icon{font-size:1.6rem}
.fui-cell-group .fui-cell {line-height:1.7;height:1.6rem}
</style>
<div class="fui-page" style="z-index: 10;">
<div class="fui-content" style="max-width:680px;margin:auto;">
<div id="sendbox" class="flex">
	<div class="chat-main flex" id="svposttext" style="padding-bottom:1rem">
			<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
			<div class="chatlog" style="padding-top:0.5rem">
			<div ng-repeat="item in pagedata.list">
						<div ng-if="item.createtime" class="logtime">{{item.createtime}}</div>
						<div ng-if="item.is_worker!=1" class="fui-cellone">
						<div class="fui-cellone-label"></div>
						<div class="fui-cellone-text">
							<p class="text" style="float: right;background:#07c160;color:#fff;" ng-bind-html="trust(item.msg)"></p>
						</div>
						<div class="fui-cellone-remark noremark">
							<img class="pic" mode="widthFix" style="background: url('{{pagedata.member.avatar || '../core/resource/images/gw-wx.png'}}') no-repeat;background-size: 100% 100%;"/>
						</div>
						</div>
						<div ng-if="item.is_worker==1" class="fui-cellone">
						<div class="fui-cellone-label">
							<img class="pic" mode="widthFix" style="background: url('{{pagedata.item.worker.logo || '../addons/jy_msgorder/resource/images/avatar.png'}}') no-repeat;background-size: 100% 100%;"/>
						</div>
						<div class="fui-cellone-text">
							<p class="text" ng-bind-html="trust(item.msg)"></p>
						</div>
						<div class="fui-cellone-remark noremark" style="text-align: left;">
							<i ng-click="tool.clip(item.msg)" class="icon icon-copy" style="font-size:0.8rem;padding:0.2rem;border-radius:0.2rem"></i>
						</div>
						</div>
			</div>
			<div class="fui-cellone">
				<div class="fui-cellone-label">
					<image class="pic" style="background: url('{{pagedata.item.worker.logo || '../addons/jy_msgorder/resource/images/avatar.png'}}') no-repeat;background-size: 100% 100%;"/>
				</div>
				<div class="fui-cellone-text">
					<div ng-if="pagedata.item.worker.welcometext" class="text" ng-bind-html="trust(pagedata.item.worker.welcometext)">
					</div>
					<div ng-if="!pagedata.item.worker.welcometext" class="text">
					您好，我是【{{pagedata.item.worker.title}}】，有什么想咨询的？
					</div>
				</div>
				<div class="fui-cellone-remark noremark" style="text-align: left;">
					<i ng-click="tool.clip(pagedata.item.worker.welcometext)" class="icon icon-copy" style="font-size:0.8rem;padding:0.2rem;border-radius:0.2rem"></i>
				</div>
			</div>
			</div>
			<div ng-include="sys_html('_listnew')"></div>
	</div>
	<div id="chat-foot" class="flex" style="height:auto">
			<div class="fui-cell-group" style="padding:0.36rem 0;;width:100%;margin-top:0">
				<div ng-if="pagedata.item.status==1 || pagedata.item.status==2" class="fui-cell" style="padding:0;">
					<div class="fui-cell-info">
						<div class="fui-cell" style="padding:0">
							<div class="fui-cell-icon" style="width:auto;height:1.2rem;line-height:1.2rem">
							<span ng-click="access_json('/index/')" class="audio icon icon-shouye l-f" style="width:1.6rem;font-size:1rem"></span>
							</div>
							<div class="fui-cell-info" style="background: #F5F5F7;border-radius:1rem;padding:0.3rem;">
							<input class="inp" style="width:100%;background: #F5F5F7;" type="text" id="contentvalue" placeholder="请输入要咨询内容..."></input>
							</div>
						</div>
					</div>
					<div class="fui-cell-remark noremark" style="margin-left:0.5rem;width:auto;margin-right:0.55rem">
						<i id="searchsub" class="icon icon-zhifeiji" ng-click="submitform()" style="font-size:1rem;color:#07c160;"></i>
					</div>
				</div>
				<div ng-if="pagedata.item.status!=1 && pagedata.item.status!=2" class="fui-cell" style="padding:0;">
					<div class="fui-cell-info c gray">
						{{pagedata.item.statustitle}}
					</div>
				</div>
			</div>
	</div>
</div>
</div>
</div>
<div class="popup" ng-if="pagedata.showtype">
	<div class="popup-body">
		<div class="popup-center" style="padding:1rem;">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showtype=false"></i>
			<div class="fui-cell-title c bold syscolor">您的金币不足，不能提问！</div>
			<div class="weui_btn weui_btn_primary" onclick="$('#showsharecover').modal();"><i class="icon icon-fenxiang2" style="margin-right:0.2rem"></i>分享好友赚金币</div>
			<div class="weui_btn weui_btn_primary" ng-click="access_json('jy_msgorder/recharge/')">直接前往充值金币</div>
			<div class="weui_btn weui_btn_primary" ng-click="access_json('jy_msgorder/home/buyvip/')">开通VIP无限对话</div>
		</div>
	</div>
</div>
<script type="text/javascript">
scope.pagedata.is_backpage=false
var curtype='text';
//滚动加载
scope.scroll(function(){
	setTimeout('getlist()',500);
},true,'svposttext');
function followewm(textimg){
	scope.pagedata.textimg = textimg;
	scope.$evalAsync();
	$('#followewm').modal();
}
var images = {
	localIds: [],
};
var voice = {
	localId: '',
	serverId: ''
};
scope.loading = true;  //状态标记
getlist(1);
$('#svposttext').animate({scrollTop:100000},300);
function getlist(isnew){
	if(isnew){
		scope.tool.get_list('jy_msgorder/tcplog/list/',true);
	}else{
		scope.tool.get_list('jy_msgorder/tcplog/list/');
	}
}
function getxml(xmlstring){
			var xmlobject = null;
			try{
				if(window.ActiveXObject){
					xmlobject =new ActiveXObject("Microsoft.XMLDOM");
					xmlobject.async="false";
					xmlobject.loadXML(xmlstring);
				}else{// 用于 Mozilla, Firefox, Opera, 等浏览器的代码：
					var parser=new DOMParser();
					xmlobject =parser.parseFromString(xmlstring,"text/xml");
				}
			}catch(e){alert("您的浏览器不支持");}
			return xmlobject;
}
scope.pagedata.getmsgkey=0;
scope.pagedata.getmsg={};
scope.submitform=function(msg) {
	//苹果手机键盘归让页面归位
	window.scroll(0,0); //让页面归位
	scope.pagedata.listnew=scope.pagedata.listnew?scope.pagedata.listnew:[];
	scope.pagedata.post.msg = $('#contentvalue').val();
	scope.post_json('jy_msgorder/tcplog/addlog/',scope.pagedata.post,function(data){
		scope.pagedata.listnew = scope.pagedata.listnew.concat(data.log)
		$('#contentvalue').val('');
		$('#svposttext').animate({scrollTop:100000},300);
		var key=scope.pagedata.listnew.length;
		scope.pagedata.listnew[key]={'msg':'','is_worker':1};
		scope.$evalAsync();
	});	
}
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>